﻿@using EvertonApp.AdminWeb.Extensions
@model EvertonApp.AdminWeb.Models.PostModel

<div class="modal-dialog">
    @using (Ajax.BeginForm("Guardar", "Post", FormMethod.Post, new AjaxOptions { UpdateTargetId = "divGridPosts", OnComplete = "closeModal();" }, new { @id = "formularioModal", enctype = "multipart/form-data" }))
    { 
        @Html.HiddenFor(mod => mod.IdPost)
        @Html.HiddenFor(mod => mod.desdeFormulario)
        @Html.HiddenFor(mod => mod.TipoPost)
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <center><h4 class="modal-title">GESTIÓN FORO</h4></center>
            </div>
            <div class="modal-body">
                <center>
                    <div class="modal-body">
                       <div class="form-horizontal">
                            <fieldset>
                            <div class="form-group">
                                @Html.LabelFor(mod => mod.Titulo, new { @class = "col-lg-3 control-label"})
                                <div class="col-lg-9">
                                    @Html.TextBoxFor(mod => mod.Titulo, new { id = "Titulo", name = "TituloPost", @class="form-control expand-input", @value = String.Empty } as object)
                                </div>
                            </div>
                            <div class="form-group">
                                @Html.LabelFor(mod => mod.Descripcion, new { @class = "col-lg-3 control-label"})
                                <div class="col-lg-9">
                                    @Html.TextBoxFor(mod => mod.Descripcion, new { id = "Descripcion", name = "DescripcionPost",@class="form-control expand-input",  @value = String.Empty } as object)
                                </div>
                            </div>
                        </fieldset>
                        </div>
                    </div>
                </center>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary">Guardar</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
            </div>
        </div>
    }
</div>

<script type="text/javascript">
    function closeModal() {
        $('#myModal').modal('hide');
    }
</script>
